package com.liqi.monitor.service.impl;


import com.liqi.common.utils.DateUtils;
import com.liqi.monitor.domain.DvHeartbeat;
import com.liqi.monitor.domain.dto.HeartBeatDto;
import com.liqi.monitor.mapper.DvHeartbeatMapper;
import com.liqi.monitor.service.IDvHeartbeatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class DvHeartbeatServiceImpl implements IDvHeartbeatService {

    @Autowired
    private DvHeartbeatMapper dvHearBeatMapper;

    @Override
    public DvHeartbeat selectDvHeartbeatByDeviceId(String deviceId) {
        return dvHearBeatMapper.selectDvHeartbeatByDeviceId(deviceId);
    }

    @Override
    public int insertDvHeartbeat(DvHeartbeat dvHeartbeat) {
    	dvHeartbeat.setHeartbeatTime(DateUtils.getNowDate());
        return dvHearBeatMapper.insertDvHeartbeat(dvHeartbeat);
    }

    @Override
    public int updateDvHeartbeat(DvHeartbeat dvHeartbeat) {
        return dvHearBeatMapper.updateDvHeartbeat(dvHeartbeat);
    }
}
